Option Explicit

Dim oRootDSE
Dim sDomain
Dim oContainer
Dim oUser

Dim sOneLine
Dim saUserData

Dim sCommandLineArgs

Set sCommandLineArgs = wscript.Arguments

WScript.StdOut.Write("Usuwanie usera z AD")
WScript.StdOut.WriteBlankLines(1)

Set oRootDSE = GetObject("LDAP://rootDSE")
sDomain = oRootDSE.Get("defaultNamingContext")
Set oContainer = GetObject("LDAP://cn=Users," & sDomain)

oContainer.Delete "user", "cn=" & sCommandLineArgs(0)

WScript.StdOut.Write("Poprawnie usunieto")
WScript.StdOut.WriteBlankLines(1)
